home *** CD-ROM | disk | FTP | other *** search
/ User's Choice Windows CD / User's Choice Windows CD (CMS Software)(1993).iso / windows5 / vlib101.zip / VLIBDEMO.C < prev    next >
C/C++ Source or Header  |  1992-04-14  |  2KB  |  54 lines

  1.  
  2. /*-------------------------------[ Vlib ]------------------------------*/
  3. /*                      Text File Viewer Library                       */
  4. /*---------------------------------------------------------------------*/
  5. /* Written by: Jeff Dunlop                                             */
  6. /* Copyright 1991 DB/Soft Publishing Co. All Rights Reserved           */
  7. /*---------------------------------------------------------------------*/
  8.  
  9. /*--------------------------[ vlibdemo.c ]-----------------------------*/
  10. /*                        Demo shell for VLib                          */
  11. /*---------------------------------------------------------------------*/
  12.  
  13. #include <stdio.h>
  14.  
  15. #include "vlib.h"
  16.  
  17. /*--------------------------------------------------------------*/
  18. /*---------------------------[ main ]---------------------------*/
  19. /*--------------------------------------------------------------*/
  20.  
  21. int main(int argc, char *argv[])
  22. {
  23.     int Fore = vlIsMono() ? LIGHTGREY : YELLOW,
  24.         Back = vlIsMono() ? BLACK : BLUE;
  25.  
  26.     BORDER bd_info = {{1}, {"┌─┐│└─┘"}, {YELLOW}, {BLUE}};
  27.  
  28.     if ( vlIsMono() )
  29.     {
  30.         bd_info.Foreground = LIGHTGREY;
  31.         bd_info.Background = BLACK;
  32.     }
  33.  
  34.     if ( argc < 2 )
  35.     {
  36.         puts("\nVlibDemo v.1.00");
  37.         puts("Copyright 1992 DB/Soft Publishing Co.");
  38.         puts("All Rights Reserved");
  39.         puts("\nSyntax: VlibDemo <view file>");
  40.         printf("\n%d Rows, %d Columns at %x were detected\n", vlGetRows(),
  41.             vlGetCols(), vlGetVidbase());
  42.         printf("Vga/Ega was %sdetected\n", vlIsEgaVga() ? "": "not ");
  43.         printf("Desqview was %sdetected\n", vlIsDV() ? "": "not ");
  44.         printf("Video is in mode %d ", vlGetVidMode());
  45.  
  46.     }
  47.     else
  48.     {
  49.         vlLister(argv[1], 1, 1, vlGetCols() - 2, vlGetRows() - 2,
  50.             Fore, Back, 0x2000, &bd_info);
  51.     }
  52.     return 0;
  53. }
  54.